﻿using Core.Domain.Common;
using System.Collections.Generic;

namespace Core.Domain.Customers
{
    public partial class CustomerAttribute : BaseEntity
    {
        /// <summary>
        /// 所属值
        /// </summary>
        private ICollection<CustomerAttributeValue> _customerAttributeValues;

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 是否必填
        /// </summary>
        public bool IsRequired { get; set; }

        /// <summary>
        /// 值控件类型
        /// </summary>
        public int AttributeControlTypeId { get; set; }

        /// <summary>
        /// 权重
        /// </summary>
        public int DisplayOrder { get; set; }


        public AttributeControlType AttributeControlType
        {
            get
            {
                return (AttributeControlType)this.AttributeControlTypeId;
            }
            set
            {
                this.AttributeControlTypeId = (int)value;
            }
        }
        
        /// <summary>
        /// 用户属性值
        /// </summary>
        public virtual ICollection<CustomerAttributeValue> CustomerAttributeValues
        {
            get { return _customerAttributeValues ?? (_customerAttributeValues = new List<CustomerAttributeValue>()); }
            protected set { _customerAttributeValues = value; }
        }
    }
}
